package org.moonlight.jvm.instructions.stack.pop;

import org.moonlight.jvm.instructions.base.NoOperandsInstruction;
import org.moonlight.jvm.rtda.exclusive.Frame;
import org.moonlight.jvm.rtda.exclusive.OperandStack;

/**
 * POP2: 把栈顶变量弹出 - double和long变量在操作数栈中占据两个位置，需要使用 pop2指令弹出
 *
 * @author Moonlight
 * @createTime 2023/8/16 17:11
 **/
public class Pop2 extends NoOperandsInstruction {
    @Override
    public void execute(Frame frame) {
        OperandStack operandStack = frame.getOperandStack();
        // double和long变量在操作数栈中占据两个位置 需要弹两次
        operandStack.popSlot();
        operandStack.popSlot();
    }
}
